package com.example.xihuashoujiduan.fragment

import android.content.Intent
import android.widget.ImageView
import com.example.xihuashoujiduan.R
import com.example.xihuashoujiduan.base.BaseFragment
import com.example.xihuashoujiduan.databinding.FragmentHomeBinding
import com.example.xihuashoujiduan.viewmodel.Mainviewmodel
import com.bumptech.glide.Glide
import com.example.xihuashoujiduan.activity.JieshoudindanActivity

class HomeFragment :BaseFragment<Mainviewmodel, FragmentHomeBinding>(R.layout.fragment_home) {

    val imageUrls = listOf(
        R.mipmap.yifufu,
        R.mipmap.yifufu,
        R.mipmap.yifufu

    )
    override fun initView() {
        binding.tu1.setOnClickListener {
            val intent=Intent(requireContext(), JieshoudindanActivity::class.java)
            startActivity(intent)

        }

        binding.xbn.setData(imageUrls,null)
        binding.xbn.setmAutoPalyTime(3000)
        binding.xbn.setmAutoPlayAble(true)
        binding.xbn.setmAdapter { banner, view, position ->

            Glide.with(banner.context).load(imageUrls[position]).into(view as ImageView)


        }


    }

    override fun dataObservese() {

    }
}